package com.gobrs.async.core.config;

import com.gobrs.async.core.common.constant.ConfigPropertiesConstant;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@ConfigurationProperties(prefix = RuleConfig.PREFIX)
@Component
public class RuleConfig {

    private String name;

    private String content;

    private LogConfig logConfig = defaultConfig();

    /**
     * The constant PREFIX_RULE.
     */
    public static final String PREFIX = ConfigPropertiesConstant.PREFIX + ".rules";

    /**
     * 任务流程 某任务中断是否终止整个任务流程
     */
    private boolean taskInterrupt = false;

    /**
     * 流程事务
     */
    boolean transaction = false;

    /**
     * Default config log config.
     */
    LogConfig defaultConfig() {
        return new LogConfig();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public boolean isTaskInterrupt() {
        return taskInterrupt;
    }

    public void setTaskInterrupt(boolean taskInterrupt) {
        this.taskInterrupt = taskInterrupt;
    }

    public LogConfig getLogConfig() {
        return logConfig;
    }

    public void setLogConfig(LogConfig logConfig) {
        this.logConfig = logConfig;
    }

    public boolean isTransaction() {
        return transaction;
    }

    public void setTransaction(boolean transaction) {
        this.transaction = transaction;
    }

}
